package cn.edu.sdjzu.knoverse.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.edu.sdjzu.knoverse.model.dto.system.rolePower.power.PowerAddDto;
import cn.edu.sdjzu.knoverse.model.dto.system.rolePower.power.PowerDto;
import cn.edu.sdjzu.knoverse.model.dto.system.rolePower.power.PowerUpdateBatchByParentIdDto;
import cn.edu.sdjzu.knoverse.model.dto.system.rolePower.power.PowerUpdateDto;
import cn.edu.sdjzu.knoverse.model.entity.system.Power;
import cn.edu.sdjzu.knoverse.model.vo.result.PageResult;
import cn.edu.sdjzu.knoverse.model.vo.result.Result;
import cn.edu.sdjzu.knoverse.model.vo.result.ResultCodeEnum;
import cn.edu.sdjzu.knoverse.model.vo.system.rolePower.PowerVo;
import  cn.edu.sdjzu.knoverse.service.PowerService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 权限
 */
@Tag(name = "权限", description = "权限相关接口")
@RestController
@RequestMapping("/power")
public class PowerController {

    @Autowired
    private PowerService powerService;

    @SaCheckLogin
    @Operation(summary = "获取所有权限", description = "获取所有权限")
    @GetMapping("getAllPowers")
    public Result<List<PowerVo>> getAllPowers() {
        List<PowerVo> voList = powerService.getAllPowers();
        return Result.success(voList);
    }

}
